﻿package com.obas.model.type
{
	import com.ease.common.enums.TextualEnum;
	import com.ease.lang.Enum;
	import com.ease.lang.EnumConstants;
	import com.obas.model.type.ValueRankType;

	[Bindable]
	[RemoteClass(alias="com.obas.model.type.ValueRankType")]

	public class ValueRankType extends Enum
	{
		/* static init */
		{ initEnum(ValueRankType); }

		/* Constants */
		public static const A:ValueRankType = new ValueRankType("A", "优", "A", 80, 100);
		public static const B:ValueRankType = new ValueRankType("B", "良", "B", 75, 80);
		public static const C:ValueRankType = new ValueRankType("C", "中", "C", 50, 75);
		public static const D:ValueRankType = new ValueRankType("D", "差", "D", 15, 25);
		public static const E:ValueRankType = new ValueRankType("E", "劣", "E", 0, 15);

		private var _text:String;
		private var _code:String;
		private var _min:int;
		private var _max:int;

		/*public*/ function ValueRankType(name:String=null ,text:String=null ,code:String=null ,min:int=0 ,max:int=0) {
			super.name = name;
			this._text = text;
			this._code = code;
			this._min = min;
			this._max = max;
		}

		public function get text():String  { return this._text; }
		public function get code():String  { return this._code; }
		public function get min():int  { return this._min; }
		public function get max():int  { return this._max; }

		/* constant query */
		public static function getEnumConstants():Array {
			return Enum.getEnumConstants(ValueRankType);
		}

		public static function get(constantName:String, caseSensitive:Boolean = false):ValueRankType {
			return ValueRankType(Enum.get(ValueRankType, constantName, caseSensitive));
		}
	}
}